package thinkingJava.chapter11;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Random;

public class ModifyingArraysAsList {
	public static void main(String[] args) {
		Random rand = new Random(47);
		Integer[] ia = {0,1,2,3,4,5,6,7,8,9};
		List<Integer> list1 = new ArrayList<Integer>(Arrays.asList(ia));
		System.out.println("Before shuffled : " + list1);
		Collections.shuffle(list1, rand);
		System.out.println("After shuffled : " + list1);
		System.out.println("array : " + Arrays.toString(ia));
		List<Integer> list2 = Arrays.asList(ia);
		System.out.println("Before shuffled : " + list2);
		Collections.shuffle(list2,rand);
		System.out.println("After shuffled : " + list2);
		System.out.println("array : " + Arrays.toString(ia));
	}
}
